﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MoodMng.aspx.cs" Inherits="Jy123.Web.Manage.Mood.MoodMng" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="../css/custom/jquery.ui.css" rel="stylesheet" type="text/css" />
    <link href="../css/main.css" rel="stylesheet" type="text/css" />

    <script src="../js/jquery.js" type="text/javascript"></script>

    <script src="../js/jquery.ui.js" type="text/javascript"></script>

    <script src="../js/main.js" type="text/javascript"></script>

    <title>无标题页</title>

    <script language="javascript" type="text/javascript">
function del(id)
{
    if(confirm('你确认删除吗?'))
        self.location="?Type=del&id="+id;
}
function delAll()
{
    if(confirm('你确认删除所有吗?此操作不可逆！'))
        self.location="?Type=delAll";
}
function Recommended(id,flag,p)
{
    var str="你确定要推荐吗？";
    if(flag==2)
    {
        str="你确定要取消推荐吗？";
    }
    if(confirm(str))
        self.location="?Type=Recommended&pg="+p+"&id="+id+"&flagrec="+flag;
}
function Islock(id,flag)
{
    var str="确定要锁定吗？";
    if(flag==2)
    {
        str="确定取消推荐吗？";
    }
    if(confirm(str))
        self.location="?Type=Islock&id="+id+"&flag="+flag;
}

    </script>

    <style type="text/css">
        .style2
        {
            width: 139px;
        }
        .style4
        {
            width: 162px;
        }
        .style5
        {
            width: 268px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <h4>
        <a href="#"><span>心情管理</span></a></h4>
    <div class="register">
        <h5>
            搜索</h5>
        <ul>
            <li>
                <asp:DropDownList runat="server" ID="Condtion">
                    <asp:ListItem Value="1">按作者姓名</asp:ListItem>
                    <asp:ListItem Value="2" Selected="true">按内容</asp:ListItem>
                </asp:DropDownList>
            </li>
            <li>排序方式</li>
            <li>
                <asp:DropDownList runat="server" ID="Order">
                    <asp:ListItem Value="1">按发表日期</asp:ListItem>
                    <asp:ListItem Value="2">按作者姓名</asp:ListItem>
                    <asp:ListItem Value="3">按评论数</asp:ListItem>
                </asp:DropDownList>
            </li>
            <li>
                <asp:TextBox ID="Key" runat="server" Width="281px" CssClass="text"></asp:TextBox></li>
            <li>
                <asp:Button ID="BtnSearch" CssClass="button" runat="server" Text=" 搜索 " OnClick="BtnSearch_Click"
                    Width="94px" /></li>
        </ul>
    </div>
    <asp:Repeater runat="server" ID="RptData">
        <HeaderTemplate>
            <table class="tblist">
                <tr>
                    <th>
                        编号
                    </th>
                    <th>
                        内容
                    </th>
                    <th>
                        发布者
                    </th>
                    <th>
                        发布时间
                    </th>
                    <th>
                        评论数
                    </th>
                    <th>
                        状态
                    </th>
                    <th>
                        是否推荐
                    </th>
                    <th>
                        操作
                    </th>
                </tr>
        </HeaderTemplate>
        <ItemTemplate>
            <tr id="<%#Eval("ID") %>">
                <td>
                    <%#Container.ItemIndex + 1 + pagesize * (cpage - 1) %>
                </td>
                <td>
                    <%# DataBinder.Eval(Container.DataItem, "MoodContent").ToString()%>
                </td>
                <td>
                    <a href="../../user/?r=<%# DataBinder.Eval(Container.DataItem, "FUser")%>" target="_blank">
                        <%# DataBinder.Eval(Container.DataItem, "UserName")%></a>
                </td>
                <td>
                    <%# DataBinder.Eval(Container.DataItem, "PostTime")%>
                </td>
                <td>
                    <%# DataBinder.Eval(Container.DataItem, "Comments")%>
                </td>
                <td>
                    <%# ShowLock(DataBinder.Eval(Container.DataItem, "IsLock"))%>
                </td>
                <td>
                    <%# Rec(Eval("isRec"))%>
                </td>
                <td>
                    <a class="btnsty" href="javascript:del(<%# Eval("ID")%>);">删除</a>
                    <%--<%# ShowLock(Eval("IsLock"),Eval("ID"))%> --%>
                    <%--<%# ShowRec(Eval("isRec"),Eval("ID"))%>--%>
                    <%# Lock(Eval("IsLock"), Eval("ID"),1)%>
                    <%# Rec(Eval("isRec"),Eval("ID"), 1)%>
            </tr>
        </ItemTemplate>
        <FooterTemplate>
        <tr>
                <td colspan="8" style="text-align: right;">
                    <% =string.Format("当前{0}/{1},共{2}条记录", cpage, count[1], count[0]) + PageString((int)count[1], cpage, "photo.aspx?page=$num$")%>
                </td>
            </tr>
            </table>
        </FooterTemplate>
    </asp:Repeater>
    </form>
</body>
</html>
